package com.xykj.service.impl;

import com.xykj.mapper.ChinaIndexMapper;
import com.xykj.pojo.dto.ChinaIndexDto;
import com.xykj.service.ChinaIndexService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ChinaIndexServiceImpl implements ChinaIndexService {
    @Autowired
    private ChinaIndexMapper chinaIndexMapper;
    @Override
    public List<ChinaIndexDto> queryChinaIndex(Integer pageNum, Integer pageSize) {
        int offset = (pageNum - 1) * pageSize;
       return chinaIndexMapper.queryChinaIndex(offset, pageSize);
    }

    @Override
    public Integer totalChinaIndex() {
        return chinaIndexMapper.queryChinaIndexCount();
    }
}
